<div class="subnav">
	<ul class="nav nav-pills">
	<?php foreach ($listMenu as $controller => $menu) :?>
		<?php $class			= ($controller == $currController) ? 'active' : null;?>
		<li class="<?php echo $class;?>"><a href="<?php echo Yii::app()->createUrl($controller);?>"><?php echo $menu;?></a></li>
	<?php endforeach;?>
	</ul>
	<div class="search-form">
		<?php if(!Yii::app()->user->isGuest && !Util::isRegister()):?>
		<?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>Yii::app()->createUrl('site/search'),
			'id' => 'search-post',
			'htmlOptions' => array('style' => 'margin-bottom: -10px;')
		)); ?>
			<div style="display:none;">
				<?php echo CHtml::hiddenField('_method', 'POST');?>
			</div>
			<div class="input text">
				<label for="title"></label>
				<?php echo CHtml::textField('key_search', '', array('autocomplete' => 'off', 'placeholder' => 'Tìm gì đó...', 'class' => 'searchinput ui-autocomplete-input'))?>
			</div>
			<?php echo CHtml::image(Util::themeUrl() . '/images/ajax-loading.gif', '', array('id' => 'loadingloading',  'style' => 'display:none' ));?>
			<div class="submit">
				<?php echo Chtml::submitButton('Search', array('id' => 'submit-search-post', 'style' => 'display:inline;height:0px;width:0px;visibility:hidden;'))?>
			</div>
			<script type="text/javascript">
			//<![CDATA[
				$("#submit-search-post").bind('click', function(){
					$('#loading').show();
					$('#search-post').submit;
//					$.ajax({
//						async:true,
//						type:'post',
//						beforeSend:function(request) {$('#loading').show();},
//						complete:function(request, json) {
//							$('#blog').html(request.responseText);
//							$('#loading').hide();
//						},
//						url:'/posts/search',
//						data:$(this).parents('form:first').serialize()
//					});
				});
			//]]>
			</script>
		<?php $this->endWidget();?>
		<?php endif;?>
	</div>
</div>